<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib prefix="app" uri="http://www.wanrenhui.com"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<%@include file="/res/include/base-head.jsp"%>
<%@include file="/res/include/jquery-easyui.jsp"%>
<script type="text/javascript" src="${pageContext.request.contextPath}/res/js/draw/drawBase.js"></script>
</head>
<body>
<form id="data-form">
	<div class="form_item">
		<dl>
			<dt>名称：</dt>
			<dd>
				<input  type="text" id="name" name="name"/>
			</dd>
		</dl>
		<dl>
			<dt>描述：</dt>
			<dd>
				<textarea class="txt grid-75" id="remark" name="remark" oninput="admin.drawBase.netMsgChange('remark',360)" onpropertychange="admin.drawBase.netMsgChange('remark',360)" rows="4" ></textarea>
			</dd>
		</dl>
		 <dl>
        <dt>开始时间：</dt>
	       <dd>
	       		<fmt:formatDate var="startAt" value="${drawBaseVo.startAt}" pattern="yyyy-MM-dd HH:mm:ss"/>
	       		<input id="startAt" type="text" class="txt easyui-datetimebox grid-15" name="startAt" value="${startAt}" data-options="required:false,validType:'datetime'" />
	       </dd>
    	</dl>
   		<dl>
        <dt>结束时间：</dt>
        <dd>
        	<fmt:formatDate var="endAt" value="${drawBaseVo.endAt}" pattern="yyyy-MM-dd HH:mm:ss"/>
        	<input id="endAt" type="text" class="txt easyui-datetimebox grid-15" name="endAt" value="${endAt}" data-options="required:false,validType:'datetime'" />
        </dd>
    </dl>
		<p class="page_btn"><input type="button" id="saveBtn" value="保存" class="btn_blue" onclick="add();"/></p>
	</div>
</form>
</body>
<script type="text/javascript">
	function add(){
		var data = $('#data-form').form('jsonObject');
		if($("#bizzType").val()==3||$("#bizzType").val()==4){
			var categoryId=$("input[name='baseVo']:checked").val();
			if(null==categoryId||''==categoryId){
				top.showInfo('请选择类目');
				return;
			}
			data.categoryId=categoryId;
		}
		var url = contextPath + '/draw/base/add';
		 $.post(url, data, function(data) {
			top.addTab("",'优惠卷列表', contextPath+'/draw/base/list');
		}); 
	}
	
</script>
</html>
